@use "sass:color";
@import "../css/variables";

.navbar {
  position: absolute;
  top: 2.75rem;
  width: 100%;

  a {
    color: $gray-800;
  }

  a.navbar-menu-item, .dropdown-title {
    text-transform: uppercase;

    &:hover {
      text-decoration: none;
      color: color.adjust($gray-800, $lightness: 30);
      transition: $button-color-transition;
    }
  }

  .navbar-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;

    .navbar-logo {
      img {
        width: 8.3rem;
      }

      flex: 1;
    }

    .navbar-collapse-button {
      display: none;
      cursor: pointer;

      @media (max-width: $lg) {
        display: inline-block;
      }

      span {
        display: block;
        width: 33px;
        height: 4px;
        margin-bottom: 5px;
        position: relative;
        background: $gray-800;
        border-radius: 3px;
        z-index: 1;
        transform-origin: 4px 0;
        transition:
          transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
          background 0.5s cubic-bezier(0.77, 0.2, 0.05, 1),
          opacity 0.55s ease;
      }

      span:first-child {
        transform-origin: 0% 0%;
      }

      span:nth-last-child(2) {
        transform-origin: 0% 100%;
      }
    }

    .navbar-right {
      display: flex;
      flex-direction: row;
      align-items: baseline;
      margin-bottom: 10px;

      @media (max-width: $lg) {
        max-height: 0;
        transition: max-height 200ms ease-in-out;
        box-shadow: 0 2px 5px 0 rgba(0 0 0 / 10%);
        flex-direction: column;
        position: absolute;
        top: 2.75rem;
        left: $spacer * 0.8;
        right: $spacer * 0.8;
        background-color: $gray-100;
        overflow-x: auto;
        overflow-y: hidden;
      }
    }

    .navbar-menu {
      .navbar-menu-item {
        font-weight: 400;
        margin-right: $spacer * 2.5;

        &.with-drop-down {
          margin-right: $spacer * 1.8;
        }

        @media (max-width: $xl) {
          margin-right: $spacer * 1.5;
        }

        @media (max-width: $lg) {
          display: block;
          margin-bottom: $spacer;
          font-size: 1.2rem;
        }

        .external-link-icon {
          margin-left: 0.25em;
        }
      }

      @media (max-width: $lg) {
        flex-direction: column;
        padding: $spacer;
      }
    }

    .navbar-social {
      margin-left: $spacer * 1.6;
      font-size: $font-size-small;

      svg {
        height: 16px;
        margin-bottom: 2px;

        @media (max-width: $lg) {
          height: 1rem;
        }
      }

      @media (max-width: $xl) {
        margin-left: $spacer;
      }

      @media (max-width: $lg) {
        margin-left: auto;
        padding: 0 $spacer $spacer 0;
        font-size: 1rem;
      }
    }
  }

  @media (max-width: $md) {
    top: $spacer;
  }

  .page & {
    top: 0;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
    position: fixed;
    background-color: #fff;
    z-index: 2;
  }
}
